<%--
  Created by IntelliJ IDEA.
  User: Adminis
  Date: 2025/3/19
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的订单</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/home/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/home/js/bootstrap.min.js"></script>

    <style>
        body {
            background-image: url("${pageContext.request.contextPath}/home/images/Kitty3.png");
            background-size: cover;
            background-repeat: no-repeat;
        }

        thead th {
            background-color: rgba(255, 209, 2, 0.301);
        }

        tbody tr:hover {
            background-color: rgba(245, 245, 245, 0.5);
        }

        table {
            margin-top: 100px;
        }

        .fanhui {
            text-decoration: none;
            display: inline-block;
            width: 120px;
            text-align: center;
            height: 30px;
            background: rgba(79, 255, 182, 0.336);
            line-height: 30px;
            border-radius: 20px;
            float: right;
            margin-right: 80px;
        }

        a {
            color: black;
            transition: box-shadow 0.3s ease; /* 添加过渡效果 */
        }

        a:hover {
            text-decoration: none;
            color: rgb(229, 255, 0);
            background: rgba(235, 16, 255, 0.452);
            box-shadow: 0 0 10px rgba(235, 16, 255, 0.452);
        }

        .wzf{
            background-color: rgba(255, 233, 128, 0.91);
        }
        .yzf{
            background-color: rgba(135, 253, 96, 0.91);
        }

    </style>
    <c:if test="${u == null}">
        <script>
            window.parent.location.href = "${pageContext.request.contextPath}/homepage/toHomeLogin";
        </script>
    </c:if>
</head>
<body>
<div class="container">
    <table class="table">
        <thead>
        <tr>
            <th scope="col">#</th>
            <th scope="col">订单人</th>
            <th scope="col">订单路线</th>
            <th scope="col">订单价格</th>
            <th scope="col">订单状态</th>
            <th scope="col">下单时间</th>
            <th scope="col">操作</th>
        </tr>
        </thead>
        <tbody class="table-group-divider">
        <c:forEach items="${orderInfos}" var="order_info">
            <tr>
                <th scope="row">${order_info.order_info_id}</th>
                <td>${order_info.user.user_name}</td>
                <td>${order_info.route.route_name}</td>
                <td>${order_info.order_info_price}</td>
                <td>${order_info.order_info_state == 0 ? "未支付" : "已支付"}</td>
                <td><fmt:formatDate value="${order_info.order_info_date}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                <td>
                    <a class="btn btn-default btn-sm ${order_info.order_info_state == '0'?'wzf' : 'yzf'}" href="${pageContext.request.contextPath}/homepage/updateOrder_infoByState?order_info_id=${order_info.order_info_id}">${order_info.order_info_state == "0"?"去支付" : "已支付"}</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <a class="fanhui" href="${pageContext.request.contextPath}/homepage/toMypage">返回个人主页</a>

</div>


</body>
</html>